<template>
	<view class="_company_item">
		<view class="u-p-l-32 u-p-r-32 ">

      <view class="sta-sty">
        <view :class="['status', data.isOperate == 0 ? 'success' : '']">{{data.isOperate == 0 ? '住户' : '营业场所'}}</view>
        <view :class="['status1', data.checkStatus == 1 ? 'success1' : '']">{{data.checkStatus == 1 ? '已核查' : '未核查'}}</view>
      </view>


			<view class="f-s-16 f-w-b u-line-1">{{data.roomNo}}</view>
<!--			<view class="u-flex u-flex-items-center u-m-t-12 " >-->
<!--				<status bgColor="rgba(22,119,255,0.1)" color="#1677FF" text="经发认证"></status>-->
<!--				<status class="u-m-l-12" bgColor="rgba(22,119,255,0.1)" color="#1677FF" text="公安已认证"></status>-->
<!--			</view>-->

			<view class="u-m-t-24 f-s-14 u-flex u-flex-self-start" v-if="data.isOperate == 1">
				<view class="_title u-tips-color">场所名称</view>
				<view>{{data.operateName}}</view>
			</view>

      <view class="u-m-t-24 f-s-14 u-flex u-flex-self-start" v-else>
        <view class="_title u-tips-color">住户姓名</view>
        <view>{{data.operateName}}</view>
      </view>

			<view class="u-m-t-24 f-s-14 u-flex" v-if="data.isOperate == 1">
				<view class="_title u-tips-color">场所类型</view>
				<view> {{type.filter(d=>d.value==data.operateType)[0].text}}</view>
			</view>

      <view class="u-m-t-24 f-s-14 u-flex" v-else>
        <view class="_title u-tips-color">身份证号</view>
        <view>{{data.legal}}</view>
      </view>

			<view class="u-m-t-24 f-s-14 u-flex" v-if="data.isOperate == 1">
				<view class="_title u-tips-color">法人信息</view>
				<view>{{ data.legal }}</view>
			</view>

      <view class="u-m-t-24 f-s-14 u-flex" v-else>
        <view class="_title u-tips-color">房间人数</view>
        <view>{{ data.urgentContactTel }}</view>
      </view>






			<view class="u-m-t-24 f-s-14 u-flex">
				<view class="_title u-tips-color">联系方式</view>
				<view>{{data.legalTel}}</view>
			</view>


		</view>
		<up-line margin="24rpx 0 "></up-line>
		<view class="u-flex u-flex-end u-flex-items-center u-p-l-32 u-p-r-32">


      <view  v-if="data.isOperate == 0">
        <up-button  text="房间详情" :customStyle="{
					width: '176rpx',
					height: '56rpx',
					background: '#1677FF',
					borderRadius: '8rpx',
					fontSize: '28rpx',
					color: '#FFFFFF',
				}" @click="toPeople"></up-button>
      </view>

			<view class="u-m-r-24"  v-else>
<!--        v-if="data.isOperate == 1"-->
				<up-button  text="场所详情" :customStyle="{
					width: '176rpx',
					height: '56rpx',
					border: '1rpx solid #E5E5E5',
					background: '#1677FF',
					borderRadius: '8rpx',
					fontSize: '28rpx',
					color: '#FFFFFF',
				}" @click="toCompanyInfo"></up-button>
			</view>

<!--      v-else-->

		</view>
	</view>
</template>

<script setup>

	import Status from '@/components/common/Status.vue'
	const props = defineProps({
		data: Object,
	})
	const toCompanyInfo = () => {
		uni.navigateTo({
			url: '/subPackages/apartment/shopinfo?id=' + props.data.id + '&name=' + props.data.name,
		})
	}
	const toPeople = () => {
		uni.navigateTo({
			url: '/subPackages/apartment/user_list?id=' + props.data.roomNo + '&apart=' + props.data.apartId,
		})
	}

  const type = [
    {
      text: '餐饮',
      value: '1'
    },
    {
      text: '服务',
      value: '2'
    },
    {
      text: '其他',
      value: '3'
    },
  ]
	
</script>

<style lang="scss" scoped>
.status {
  display: inline-block;
  min-width: 76rpx;
  line-height: 32rpx;
  color: #de851d;
  background: rgba(222, 133, 29, 0.1);
  border-radius: 4rpx;
  font-size: 20rpx;

  text-align: center;
  //position: absolute;
  //right: 62rpx;
  //top: 36rpx;
  padding: 10rpx;
  &.success {
    min-width: 96rpx;
    color: #1777ff;
    background: rgba(23, 119, 255, 0.1);
  }

}

.sta-sty{
  position: absolute;
  right: 30rpx;
  //top: 36rpx;
  padding: 10rpx;
  display: flex;
}

.status1 {
  margin-left: 8rpx;
  display: inline-block;
  min-width: 76rpx;
  line-height: 32rpx;
  color: #fb393b;
  background: rgba(251, 57, 59, 0.1);
  border-radius: 4rpx;
  font-size: 20rpx;

  text-align: center;
  //position: absolute;
  //right: 152rpx;
  //top: 36rpx;
  padding: 10rpx;
  &.success1 {
    min-width: 96rpx;
    color: #34cc0a;
    background: rgba(25, 213, 19, 0.1);
  }
}


	._company_item {
		background: #FFFFFF;
		box-shadow: 0rpx 2rpx 20rpx 0rpx rgba(0, 0, 0, 0.05);
		border-radius: 16rpx;
		padding: 32rpx 0;
		margin-bottom: 24rpx;

		._title {
			min-width: 144rpx;
			width: 144rpx;
		}

	}
</style>